// Function called from the front page for the group code dialog box.
//How to include this is function in any php page: 
//<script src="<?php bloginfo('stylesheet_directory'); ?>/javascript/cityselect.js"></script>
function populate_Cities() {
	var statesList = document.frmMain.states;
	var stateValue = statesList[statesList.selectedIndex].value;
		$.post(ajaxurl, {'action': 'popCities', 'state': stateValue}, function(temp){
		if(document.frmMain.cities){
		document.frmMain.removeChild(document.getElementById('choose_city'));
		}
		var element=document.frmMain;
		var newdiv =document.createElement('div');
		newdiv.setAttribute('id','choose_city');
		newdiv.innerHTML=temp;
		element.appendChild(newdiv);
		});
}

